import request from '@/utils/request'

// 查询行业资讯（新闻）列表
export function listNews(query) {
  return request({
    url: '/manage/news/list',
    method: 'get',
    params: query
  })
}

// 查询行业资讯（新闻）详细
export function getNews(tradeNewsId) {
  return request({
    url: '/manage/news/' + tradeNewsId,
    method: 'get'
  })
}

// 新增行业资讯（新闻）
export function addNews(data) {
  return request({
    url: '/manage/news',
    method: 'post',
    data: data
  })
}

// 修改行业资讯（新闻）
export function updateNews(data) {
  return request({
    url: '/manage/news',
    method: 'put',
    data: data
  })
}

// 删除行业资讯（新闻）
export function delNews(tradeNewsId) {
  return request({
    url: '/manage/news/' + tradeNewsId,
    method: 'delete'
  })
}

// 导出行业资讯（新闻）
export function exportNews(query) {
  return request({
    url: '/manage/news/export',
    method: 'get',
    params: query
  })
}

// 行业资讯状态的修改
export function changeNewstate(tradeNewsId,state){
  tradeNewsId=parseInt(tardeNewsId);
  const data={
    tradeNewsId,
    state
  }
  return request({
    url: 'manage/news/changeState'
  })
}
